In recent years, as various types of data such as character codes, image data and so on are processed by a computer, the data amount to be processed is increasing. In addition, there has been increasing consciousness about the security in storing data and performing data communication, as the Internet and mobile terminals become widely used. Therefore, there have been more cases in which not only data-amount reducing function but also data-concealment function is required.
In a conventional data compression method, the compression process and the cryptographic process are performed independently, as illustrated in FIG. 1. First, in order to reduce the data amount of original data 101, the original data 101 is compressed to generate compressed data 102, and next, in order to ensure the security, the compressed data 102 is encrypted to generate compressed and encrypted data 103. However, this method has a problem that a high processing load is imposed on the computer, since both the compression process and the cryptographic process are performed for the whole of the data.
Therefore, in order to reduce the processing load, a method of reducing encryption target data has been proposed, as illustrated in FIG. 2 (for example, see Patent Document 1 specified below). First, original data 201 is compressed to generate compressed data 202, and next, utilizing a characteristic that it is difficult to decompress the original data 201 from the middle of the compressed data 202, only the head of the compressed data 202 is encrypted to generate compressed and encrypted data 203. However, with this method, the possibility cannot be ruled out that the original data 201 may be decompressed from the middle of the compressed and encrypted data 203 using the frequency distribution analysis and the like.
As a conventional data compression method, the context model compression method has been known (see, for example, Non-patent Document 1 specified below). This method raises the compression rate by increasing the prediction accuracy of the next character by using the context.
Patent Document 2 specified below relates to a method of compression while assigning a scramble value to the head of a data string, and Non-patent document 2 specified below relates to a fixed-to-variable length code (FV code) and a variable-to-fixed length code (VF code).    [Patent Document 1] International Publication Pamphlet No. WO97/10659    [Patent Document 2] Japanese Laid-open Patent Publication No. 2005-217842    [Non-patent Document 1] John G. Cleary et al., “Unbounded Length Contexts for PPM”, 1995 IEEE Data Compression Conference, p. 52-61    [Non-patent Document 2] Tomohiko Uematsu, “Introductory Document Data Compression Algorithm”, 1994 CQ Publishing, p. 26-28, 131